
let k_li = {
    10:0.14865,
    11:0.16892,
    12:0.18919,
    13:0.20946,
    14:0.22973,
    15:0.25000,
    16:0.27703,
    17:0.29730,
    18:0.31757,
    19:0.34460,
    20:0.36487,
    21:0.37838,
    22:0.39189,
    23:0.40541,
    24:0.41216,
    25:0.42568,
    26:0.43919,
    27:0.45271,
    28:0.46622,
    29:0.47973,
    30:0.48649,
    31:0.50000,
    32:0.51352,
    33:0.52703,
    34:0.53379,
    35:0.54730,
    36:0.56081,
    37:0.56757,
    38:0.58108,
    39:0.59460,
    40:0.60135,
    41:0.65541,
    42:0.62838,
    43:0.63514,
    44:0.64865,
    45:0.65541,
    46:0.66892,
    47:0.67568,
    48:0.68919,
    49:0.69595,
    50:0.70946,
    51:0.71622,
    52:0.72298,
    53:0.73649,
    54:0.74325,
    55:0.75000,
    56:0.76352,
    57:0.77027,
    58:0.77703,
    59:0.78379,
    60:0.78379,
    61:0.79730,
    62:0.80406,
    63:0.81082,
    64:0.81757,
    65:0.82433,
    66:0.83109,
    67:0.84460,
    68:0.85136,
    69:0.85811,
    70:0.86487,
    71:0.87163,
    72:0.88514,
    73:0.89190,
    74:0.89865,
    75:0.90541,
    76:0.91217,
    77:0.91892,
    78:0.93244,
    79:0.93919,
    80:0.94595,
    81:0.94595,
    82:0.95271,
    83:0.95271,
    84:0.95946,
    85:0.95946,
    86:0.96622,
    87:0.96622,
    88:0.96622,
    89:0.97298,
    90:0.97298,
    91:0.97974,
    92:0.97974,
    93:0.98649,
    94:0.98649,
    95:0.99325,
    96:0.99325,
    97:0.99325,
    98:1.00001,
    99:1.00001,  
    101: 1.0067567567567568,
    102: 1.0135135135135136,
    104: 1.0135135135135136,
    105: 1.0202702702702702,
    107: 1.0202702702702702,
    108: 1.027027027027027,
    110: 1.0337837837837838,
    111: 1.0405405405405406,
    113: 1.0405405405405406,
    114: 1.0472972972972974,
    116: 1.0472972972972974,
    117: 1.054054054054054,
    119: 1.0608108108108107,
    120: 1.0675675675675675,
    122: 1.0675675675675675,
    123: 1.0743243243243243,
    125: 1.0743243243243243,
    126: 1.0810810810810811,
    128: 1.087837837837838,
    129: 1.0945945945945945,
    131: 1.0945945945945945,
    132: 1.1013513513513513,
    134: 1.1013513513513513,
    135: 1.1081081081081081,
    137: 1.114864864864865,
    138: 1.1216216216216217,
    140: 1.1216216216216217,
    141: 1.1283783783783783,
    143: 1.1283783783783783,
    144: 1.135135135135135,
    146: 1.1418918918918919,
    147: 1.1486486486486487,
    149: 1.1486486486486487 
}


// 9     5d 力敏  // 力敏信4d
// 15 10 11
// 14 13 9 9 7

// 7     5d 力
// 14 9 12 
// 16 9 7 8 11

// 5     4d 敏感
// 10 11 10
// 9 13 9 8 14

// 6     6d 智敏
// 9 15 9
// 8 12 16 7 9

// 7     3d 力敏感信
// 10 14 8
// 11 10 7 16 10

// 9     5d  力敏
// 12 11 13
// 12 15 9 8 8

// 10    2d  力敏信
// 10 13 10
// 12 12 9 14 9

// 9     5d  力敏智
// 11 12 11
// 11 14 14 6 9


// let data = [
//     {
//         name: "test",
//         type: "sword",
//         correction: "aa",
//         abnormal: "(blood)100",
//         dmg: {
//             normal: 560,
//             heavy: 500,
//             cut: 520,
//             quality: 531,
//             mysterious: 543,1.1081081081081081
//             abnormal: 540,
//             blood_k: 105,
//             poison_k: 110,
//             fire_thunder: 620,
//             fire_magic_sacred: 631,
//             ice: 626,
//             ice_k: 100
//         },
//     }
// ]


// 50 0.70946


let shuxin = {
    li:10, min:10, zhi:10, xin:10, gan:10
}
// s  125%+      1.35
// a  100%~125%  1.15
// b  75%~100%  0.85
// c  50%~75%   0.65
// d  25%~50%   0.40
// e  0~25%    0.2

let ret = []

let lvpoint = 56
for (let index = 0; index < lvpoint; index++) {
    for (let index2 = 0; index2 < (lvpoint-index); index2++) {
        let index3 = lvpoint-index-index2
        ret.push({
            shuxin:{...shuxin,li:(10+index)*1.5,min:10+index2,gan:10+index3},
            point:calcMianban({
                shuxin:{...shuxin,li:(10+index)*1.5,min:10+index2,gan:10+index3},
                weapon: {
                    base1:337, base2:0, liK:1.5, minK:0, zhiK:0, xinK:0 ,ganK:0
                }
            })
        })
    }
}
console.log("============");
ret = ret.sort(function(b,a){return a.point.all - b.point.all})

console.log(ret[0]);
console.log(ret[1]);
console.log(ret[2]);
console.log(ret[3]);
console.log(ret[4]);

function calcMianban(props) {
    let {shuxin} = props
    let {li, min, zhi, xin, gan} = shuxin
    li = Math.round(li)
    if(li > 149) {
        li = 149
    }
    if(min > 99) {
        min = 99
    }
    if(zhi > 99) {
        zhi = 99
    }
    if(xin > 99) {
        xin = 99
    }
    if(gan > 99) {
        gan = 99
    }
    let {weapon} = props
    let {base1, base2, liK, minK, zhiK, xinK ,ganK} = weapon
    let wuli = 0;
    let special = 0;
    
    if(liK) {
        wuli += base1 * liK * k_li[li]
    }
    if(minK) {
        wuli += base1 * minK * k_li[min]
    }
    if(ganK) {
        wuli += base1 * ganK * k_li[gan]
    }
    if(zhiK) {
        special += base1 * zhiK * k_li[zhi]
    }
    if(xinK) {
        special += base1 * xinK * k_li[xin]
    }
    if(Number.isNaN(wuli) || Number.isNaN(special)) {
        console.log("NAN :");
        console.log(props);
    }
    return {
        wuli: base1 + "+" + wuli.toFixed(0) + "=" + (base1 + wuli).toFixed(0),
        special: base2 + "+" + special.toFixed(0) + "=" + (base2 + special).toFixed(0),
        all: base1 + wuli + base2 + special
    }
}












// 7    

// 14 
// 9 
// 12 

// 16 
// 9 
// 7 
// 8 
// 11